package fileexplorer.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created with IntelliJ IDEA.
 * User: rejeev
 * Date: 4/28/13
 * Time: 5:09 PM
 * To change this template use File | Settings | File Templates.
 */
public class Invoker {
    private static final Logger LOGGER = LoggerFactory.getLogger(Invoker.class);
    private static Runtime runtime = Runtime.getRuntime();
    public static void invoke(String file, String program){
        try {
            String[] command = {program, file};
            runtime.exec(command);
        } catch (Exception e) {
            LOGGER.error("Failed to invoke file: " + file + "; with program: " + program, e);
        }
    }
}
